import { Spin } from 'antd';
import React, {useState,useTransition  } from 'react'

export default function Index() {

  const [isPending,startTransition] = useTransition();

  const [count,setCount]  = useState(6);

  function changeCount(){
    startTransition(() => {
        setCount(c => c + 1)
    })
  }

  return (
    <>
    <div>useTransition</div>
    <div>{isPending && <Spin />}</div>
    <p>count:{count}</p>
    <input type="button" value="修改count" onClick={changeCount} />
    </>
  )
}

